package com.yunxi.controller.eai;

import com.yunxi.baseDataToHub.pojo.app.*;
import com.yunxi.baseDataToHub.service.app.AppDubboService;
import com.yunxi.core.web.ApiResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

/**
 * Created by Administrator on 2019/8/5.
 */
@RestController
@RequestMapping("/esb/api")
@Api(tags = "esb:manage", description = "接收esb信息")
public class AppController {
    @Autowired
    private AppDubboService appDubboServiceImpl;


    @PostMapping("/auditAppLittleOrder")
    @ApiOperation(value = "订单审核")
    public ApiResult auditAppLittleOrder(@RequestBody AppLittleOrderAuditVO order) throws Exception {
        ApiResult apiResult = appDubboServiceImpl.auditAppLittleOrder(order);
        return apiResult;
    }

    @PostMapping("/sendOrderStatusPMS2APP")
    @ApiOperation(value = "发送订单状态到APP")
    public ApiResult sendOrderStatusPMS2APP(@RequestBody OrderStatusVO order) throws Exception {
        ApiResult apiResult = appDubboServiceImpl.sendOrderStatusPMS2APP(order);
        return apiResult;
    }

    @PostMapping("/sendVehiclePackagePricePMS2APP")
    @ApiOperation(value = "发送车辆选装包价格到APP")
    public ApiResult sendVehiclePackagePricePMS2APP(@RequestBody List<VehiclePackagePriceVO> order) throws Exception {
        ApiResult apiResult = appDubboServiceImpl.sendVehiclePackagePricePMS2APP(order);
        return apiResult;
    }

    @PostMapping("/sendVehiclePackagePMS2APP")
    @ApiOperation(value = "发送车辆选装包配置到APP")
    public ApiResult sendVehiclePackagePMS2APP(@RequestBody List<VehiclePackageConfigVO> order) throws Exception {
        ApiResult apiResult = appDubboServiceImpl.sendVehiclePackagePMS2APP(order);
        return apiResult;
    }


    @PostMapping("/sendVehicleRetailPricePMS2APP")
    @ApiOperation(value = "发送车辆价格到APP")
    public ApiResult sendVehicleRetailPricePMS2APP(@RequestBody VehicleRetailPriceVO order) throws Exception {
        ApiResult apiResult = appDubboServiceImpl.sendVehicleRetailPricePMS2APP(order);
        return apiResult;
    }
    @PostMapping("/sendCreditInvestigationAuditPMS2APP")
    @ApiOperation(value = "PMS系统发送征信审核信息给APP系统")
    public ApiResult sendCreditInvestigationAuditPMS2APP(@RequestBody CreditInvestigationAuditVO order) throws Exception {
        ApiResult apiResult = appDubboServiceImpl.sendCreditInvestigationAuditPMS2APP(order);
        return apiResult;
    }
    @PostMapping("/sendFinanceAuditPMS2APP")
    @ApiOperation(value = "PMS系统发送金融方案审核结果给APP系统")
    public ApiResult sendFinanceAuditPMS2APP(@RequestBody FinanceAuditVO financeAuditVO) throws Exception {
        ApiResult apiResult = appDubboServiceImpl.sendFinanceAuditPMS2APP(financeAuditVO);
        return apiResult;
    }

}
